home *** CD-ROM | disk | FTP | other *** search
- Path: millenium.texas.net!gcherer
- From: gcherer@millenium.texas.net (GT Cherer)
- Newsgroups: comp.lang.c
- Subject: realloc question
- Date: 29 Jan 1996 04:23:39 GMT
- Organization: Texas Networking, Inc.
- Message-ID: <4ehi4b$qfo@news.texas.net>
- NNTP-Posting-Host: millenium.texas.net
- X-Newsreader: TIN [version 1.2 PL2]
-
- Dudes-
- Whether i am on my old 286 with 1 meg, or on my 486 with 8 meg of ram, i
- get the same result when i do a realloc on about the 50th iteration.( its
- on an array of pointers). but, when i compile and run the same program on
- a unix box (with beacoups more memory) it runs with no probs.
-
- is there a difference in realloc on a dos machine vs unix box?
- Is there some kind of limiting factor with realloc (other than the amount
- of ram), like a heap or stack size or something?? i follow the realloc
- with a calloc for a spot to put a small structure so the two lines look
- like this, with the realloc returning a NULL:
- x++;
- ptr=(struct sumthin**) realloc(ptr,(x+1) * sizeof(struct sumthin));
- ptr[x]=(struct sumthin*) calloc(1,sizeof(struct sumthin));
-
- Any ideas?? Sure preeeeeciate 'em. TIA
- --
- G.T. Jeff Cherer gcherer@texas.net
- Voice: 210-532-7524 SnailMail: 1132 Vanderbilt St. 78210
- "Comfort the afflicted: Afflict the comfortable."
-